package featuremodel.constraint;

import java.util.Vector;

import featuremodel.FeatureModelDef;
import featuremodel.method.OrMethodChild;
import featuremodel.method.OrMethodNone;

import skyblue.Constraint;
import skyblue.Strength;
import skyblue.Variable;

public class OrConstraint extends Constraint {
	
	private Variable parent;
	private Vector<Variable> children;

	public OrConstraint(Variable parent, Vector<Variable> children, Strength strength) {
		
		super(strength);
		this.constraintType = FeatureModelDef.OR_CONSTRAINT;
		getVariables().add(parent);
		getVariables().addAll(children);
		this.parent = parent;
		this.children = children;
				
		for (int i = 0; i < children.size(); i++) {
			getMethods().add(new OrMethodChild(parent,children.get(i)));
		}
		
		getMethods().add(new OrMethodNone(parent, children));

	}

	public Variable getParent() {
		return parent;
	}

	public void setParent(Variable parent) {
		this.parent = parent;
	}

	public Vector<Variable> getChildren() {
		return children;
	}

	public void setChildren(Vector<Variable> children) {
		this.children = children;
	}

}
